<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加分类</title>
</head>
<body>
<div>
    <h1>添加分类</h1>
    <form action="" method="post">
        {% csrf_token %}
        <p>分类名:<input type="text" name="name"></p>
        <p>
            父分类:
            <select name="parent">
                <option value="">无</option>
                {% for foo in type_list1 %}
                   <option value="{{ foo.id }}">{{ foo.name }}</option>
                {% endfor %}

            </select>
        </p>
        <p>
            <input type="submit" value="添加">
        </p>
    </form>

</div>
</body>
</html>